﻿using System.Windows;
using System.Windows.Controls;

namespace FazaDemo.PL.Wpf
{
    class ButtonFactory : IVisualElemFactory
    {

        private readonly string _content;

        private readonly string _name;

        private readonly RoutedEventHandler _clickHandler;

        public ButtonFactory(string content, string name, RoutedEventHandler clickHandler)
        {
            _content = content;
            _name = name;
            _clickHandler = clickHandler;
        }

        public UIElement Create()
        {
            var button = new Button { Content = _content, Name = _name };
            button.Click += _clickHandler;
            return button;
        }
    }
}